3.1.87 \(\int \frac {\sin ^2(e+f x)}{(a+b \tan ^2(e+f x))^3} \, dx\) [87]

3.1.87.1 Optimal result
3.1.87.2 Mathematica [A] (verified)
3.1.87.3 Rubi [A] (verified)
3.1.87.4 Maple [A] (verified)
3.1.87.5 Fricas [B] (verification not implemented)
3.1.87.6 Sympy [F(-1)]
3.1.87.7 Maxima [A] (verification not implemented)
3.1.87.8 Giac [A] (verification not implemented)
3.1.87.9 Mupad [B] (verification not implemented)

3.1.87.1 Optimal result

Integrand size = 23, antiderivative size = 193 \[ \int \frac {\sin ^2(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^3} \, dx=\frac {(a+5 b) x}{2 (a-b)^4}-\frac {\sqrt {b} \left (15 a^2+10 a b-b^2\right ) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{8 a^{3/2} (a-b)^4 f}-\frac {\cos (e+f x) \sin (e+f x)}{2 (a-b) f \left (a+b \tan ^2(e+f x)\right )^2}-\frac {3 b \tan (e+f x)}{4 (a-b)^2 f \left (a+b \tan ^2(e+f x)\right )^2}-\frac {b (11 a+b) \tan (e+f x)}{8 a (a-b)^3 f \left (a+b \tan ^2(e+f x)\right )} \]

output
1/2*(a+5*b)*x/(a-b)^4-1/8*(15*a^2+10*a*b-b^2)*arctan(b^(1/2)*tan(f*x+e)/a^ 
(1/2))*b^(1/2)/a^(3/2)/(a-b)^4/f-1/2*cos(f*x+e)*sin(f*x+e)/(a-b)/f/(a+b*ta 
n(f*x+e)^2)^2-3/4*b*tan(f*x+e)/(a-b)^2/f/(a+b*tan(f*x+e)^2)^2-1/8*b*(11*a+ 
b)*tan(f*x+e)/a/(a-b)^3/f/(a+b*tan(f*x+e)^2)
 
3.1.87.2 Mathematica [A] (verified)

Time = 3.56 (sec) , antiderivative size = 164, normalized size of antiderivative = 0.85 \[ \int \frac {\sin ^2(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^3} \, dx=\frac {4 (a+5 b) (e+f x)+\frac {\sqrt {b} \left (-15 a^2-10 a b+b^2\right ) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{a^{3/2}}-2 (a-b) \sin (2 (e+f x))+\frac {4 (a-b) b^2 \sin (2 (e+f x))}{(a+b+(a-b) \cos (2 (e+f x)))^2}-\frac {(a-b) b (9 a+b) \sin (2 (e+f x))}{a (a+b+(a-b) \cos (2 (e+f x)))}}{8 (a-b)^4 f} \]

input
Integrate[Sin[e + f*x]^2/(a + b*Tan[e + f*x]^2)^3,x]
 
output
(4*(a + 5*b)*(e + f*x) + (Sqrt[b]*(-15*a^2 - 10*a*b + b^2)*ArcTan[(Sqrt[b] 
*Tan[e + f*x])/Sqrt[a]])/a^(3/2) - 2*(a - b)*Sin[2*(e + f*x)] + (4*(a - b) 
*b^2*Sin[2*(e + f*x)])/(a + b + (a - b)*Cos[2*(e + f*x)])^2 - ((a - b)*b*( 
9*a + b)*Sin[2*(e + f*x)])/(a*(a + b + (a - b)*Cos[2*(e + f*x)])))/(8*(a - 
 b)^4*f)
 
3.1.87.3 Rubi [A] (verified)

Time = 0.42 (sec) , antiderivative size = 233, normalized size of antiderivative = 1.21, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.391, Rules used = {3042, 4146, 373, 402, 27, 402, 397, 216, 218}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\sin ^2(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^3} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\sin (e+f x)^2}{\left (a+b \tan (e+f x)^2\right )^3}dx\)

\(\Big \downarrow \) 4146

\(\displaystyle \frac {\int \frac {\tan ^2(e+f x)}{\left (\tan ^2(e+f x)+1\right )^2 \left (b \tan ^2(e+f x)+a\right )^3}d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 373

\(\displaystyle \frac {\frac {\int \frac {a-5 b \tan ^2(e+f x)}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a\right )^3}d\tan (e+f x)}{2 (a-b)}-\frac {\tan (e+f x)}{2 (a-b) \left (\tan ^2(e+f x)+1\right ) \left (a+b \tan ^2(e+f x)\right )^2}}{f}\)

\(\Big \downarrow \) 402

\(\displaystyle \frac {\frac {\frac {\int \frac {2 a \left (-9 b \tan ^2(e+f x)+2 a+b\right )}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a\right )^2}d\tan (e+f x)}{4 a (a-b)}-\frac {3 b \tan (e+f x)}{2 (a-b) \left (a+b \tan ^2(e+f x)\right )^2}}{2 (a-b)}-\frac {\tan (e+f x)}{2 (a-b) \left (\tan ^2(e+f x)+1\right ) \left (a+b \tan ^2(e+f x)\right )^2}}{f}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\frac {\frac {\int \frac {-9 b \tan ^2(e+f x)+2 a+b}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a\right )^2}d\tan (e+f x)}{2 (a-b)}-\frac {3 b \tan (e+f x)}{2 (a-b) \left (a+b \tan ^2(e+f x)\right )^2}}{2 (a-b)}-\frac {\tan (e+f x)}{2 (a-b) \left (\tan ^2(e+f x)+1\right ) \left (a+b \tan ^2(e+f x)\right )^2}}{f}\)

\(\Big \downarrow \) 402

\(\displaystyle \frac {\frac {\frac {\frac {\int \frac {4 a^2+9 b a-b^2-b (11 a+b) \tan ^2(e+f x)}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a\right )}d\tan (e+f x)}{2 a (a-b)}-\frac {b (11 a+b) \tan (e+f x)}{2 a (a-b) \left (a+b \tan ^2(e+f x)\right )}}{2 (a-b)}-\frac {3 b \tan (e+f x)}{2 (a-b) \left (a+b \tan ^2(e+f x)\right )^2}}{2 (a-b)}-\frac {\tan (e+f x)}{2 (a-b) \left (\tan ^2(e+f x)+1\right ) \left (a+b \tan ^2(e+f x)\right )^2}}{f}\)

\(\Big \downarrow \) 397

\(\displaystyle \frac {\frac {\frac {\frac {\frac {4 a (a+5 b) \int \frac {1}{\tan ^2(e+f x)+1}d\tan (e+f x)}{a-b}-\frac {b \left (15 a^2+10 a b-b^2\right ) \int \frac {1}{b \tan ^2(e+f x)+a}d\tan (e+f x)}{a-b}}{2 a (a-b)}-\frac {b (11 a+b) \tan (e+f x)}{2 a (a-b) \left (a+b \tan ^2(e+f x)\right )}}{2 (a-b)}-\frac {3 b \tan (e+f x)}{2 (a-b) \left (a+b \tan ^2(e+f x)\right )^2}}{2 (a-b)}-\frac {\tan (e+f x)}{2 (a-b) \left (\tan ^2(e+f x)+1\right ) \left (a+b \tan ^2(e+f x)\right )^2}}{f}\)

\(\Big \downarrow \) 216

\(\displaystyle \frac {\frac {\frac {\frac {\frac {4 a (a+5 b) \arctan (\tan (e+f x))}{a-b}-\frac {b \left (15 a^2+10 a b-b^2\right ) \int \frac {1}{b \tan ^2(e+f x)+a}d\tan (e+f x)}{a-b}}{2 a (a-b)}-\frac {b (11 a+b) \tan (e+f x)}{2 a (a-b) \left (a+b \tan ^2(e+f x)\right )}}{2 (a-b)}-\frac {3 b \tan (e+f x)}{2 (a-b) \left (a+b \tan ^2(e+f x)\right )^2}}{2 (a-b)}-\frac {\tan (e+f x)}{2 (a-b) \left (\tan ^2(e+f x)+1\right ) \left (a+b \tan ^2(e+f x)\right )^2}}{f}\)

\(\Big \downarrow \) 218

\(\displaystyle \frac {\frac {\frac {\frac {\frac {4 a (a+5 b) \arctan (\tan (e+f x))}{a-b}-\frac {\sqrt {b} \left (15 a^2+10 a b-b^2\right ) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{\sqrt {a} (a-b)}}{2 a (a-b)}-\frac {b (11 a+b) \tan (e+f x)}{2 a (a-b) \left (a+b \tan ^2(e+f x)\right )}}{2 (a-b)}-\frac {3 b \tan (e+f x)}{2 (a-b) \left (a+b \tan ^2(e+f x)\right )^2}}{2 (a-b)}-\frac {\tan (e+f x)}{2 (a-b) \left (\tan ^2(e+f x)+1\right ) \left (a+b \tan ^2(e+f x)\right )^2}}{f}\)

input
Int[Sin[e + f*x]^2/(a + b*Tan[e + f*x]^2)^3,x]
 
output
(-1/2*Tan[e + f*x]/((a - b)*(1 + Tan[e + f*x]^2)*(a + b*Tan[e + f*x]^2)^2) 
 + ((-3*b*Tan[e + f*x])/(2*(a - b)*(a + b*Tan[e + f*x]^2)^2) + (((4*a*(a + 
 5*b)*ArcTan[Tan[e + f*x]])/(a - b) - (Sqrt[b]*(15*a^2 + 10*a*b - b^2)*Arc 
Tan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a]])/(Sqrt[a]*(a - b)))/(2*a*(a - b)) - (b 
*(11*a + b)*Tan[e + f*x])/(2*a*(a - b)*(a + b*Tan[e + f*x]^2)))/(2*(a - b) 
))/(2*(a - b)))/f
 

3.1.87.3.1 Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

rule 218
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R 
t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
 

rule 373
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_ 
), x_Symbol] :> Simp[e*(e*x)^(m - 1)*(a + b*x^2)^(p + 1)*((c + d*x^2)^(q + 
1)/(2*(b*c - a*d)*(p + 1))), x] - Simp[e^2/(2*(b*c - a*d)*(p + 1))   Int[(e 
*x)^(m - 2)*(a + b*x^2)^(p + 1)*(c + d*x^2)^q*Simp[c*(m - 1) + d*(m + 2*p + 
 2*q + 3)*x^2, x], x], x] /; FreeQ[{a, b, c, d, e, q}, x] && NeQ[b*c - a*d, 
 0] && LtQ[p, -1] && GtQ[m, 1] && LeQ[m, 3] && IntBinomialQ[a, b, c, d, e, 
m, 2, p, q, x]
 

rule 397
Int[((e_) + (f_.)*(x_)^2)/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_ 
Symbol] :> Simp[(b*e - a*f)/(b*c - a*d)   Int[1/(a + b*x^2), x], x] - Simp[ 
(d*e - c*f)/(b*c - a*d)   Int[1/(c + d*x^2), x], x] /; FreeQ[{a, b, c, d, e 
, f}, x]
 

rule 402
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_.)*((e_) + (f_.)*(x 
_)^2), x_Symbol] :> Simp[(-(b*e - a*f))*x*(a + b*x^2)^(p + 1)*((c + d*x^2)^ 
(q + 1)/(a*2*(b*c - a*d)*(p + 1))), x] + Simp[1/(a*2*(b*c - a*d)*(p + 1)) 
 Int[(a + b*x^2)^(p + 1)*(c + d*x^2)^q*Simp[c*(b*e - a*f) + e*2*(b*c - a*d) 
*(p + 1) + d*(b*e - a*f)*(2*(p + q + 2) + 1)*x^2, x], x], x] /; FreeQ[{a, b 
, c, d, e, f, q}, x] && LtQ[p, -1]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4146
Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_ 
)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Sim 
p[c*(ff^(m + 1)/f)   Subst[Int[x^m*((a + b*(ff*x)^n)^p/(c^2 + ff^2*x^2)^(m/ 
2 + 1)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x 
] && IntegerQ[m/2]
 
3.1.87.4 Maple [A] (verified)

Time = 11.63 (sec) , antiderivative size = 172, normalized size of antiderivative = 0.89

method result size
derivativedivides \(\frac {-\frac {b \left (\frac {\frac {b \left (7 a^{2}-6 a b -b^{2}\right ) \tan \left (f x +e \right )^{3}}{8 a}+\left (\frac {9}{8} a^{2}-\frac {5}{4} a b +\frac {1}{8} b^{2}\right ) \tan \left (f x +e \right )}{\left (a +b \tan \left (f x +e \right )^{2}\right )^{2}}+\frac {\left (15 a^{2}+10 a b -b^{2}\right ) \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{8 a \sqrt {a b}}\right )}{\left (a -b \right )^{4}}+\frac {\frac {\left (-\frac {a}{2}+\frac {b}{2}\right ) \tan \left (f x +e \right )}{1+\tan \left (f x +e \right )^{2}}+\frac {\left (a +5 b \right ) \arctan \left (\tan \left (f x +e \right )\right )}{2}}{\left (a -b \right )^{4}}}{f}\) \(172\)
default \(\frac {-\frac {b \left (\frac {\frac {b \left (7 a^{2}-6 a b -b^{2}\right ) \tan \left (f x +e \right )^{3}}{8 a}+\left (\frac {9}{8} a^{2}-\frac {5}{4} a b +\frac {1}{8} b^{2}\right ) \tan \left (f x +e \right )}{\left (a +b \tan \left (f x +e \right )^{2}\right )^{2}}+\frac {\left (15 a^{2}+10 a b -b^{2}\right ) \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{8 a \sqrt {a b}}\right )}{\left (a -b \right )^{4}}+\frac {\frac {\left (-\frac {a}{2}+\frac {b}{2}\right ) \tan \left (f x +e \right )}{1+\tan \left (f x +e \right )^{2}}+\frac {\left (a +5 b \right ) \arctan \left (\tan \left (f x +e \right )\right )}{2}}{\left (a -b \right )^{4}}}{f}\) \(172\)
risch \(\frac {x a}{2 \left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right ) \left (a -b \right )}+\frac {5 x b}{2 \left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right ) \left (a -b \right )}+\frac {i {\mathrm e}^{2 i \left (f x +e \right )}}{8 f \left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right )}-\frac {i {\mathrm e}^{-2 i \left (f x +e \right )}}{8 f \left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right )}+\frac {i b \left (-9 a^{3} {\mathrm e}^{6 i \left (f x +e \right )}-5 a^{2} b \,{\mathrm e}^{6 i \left (f x +e \right )}+13 a \,b^{2} {\mathrm e}^{6 i \left (f x +e \right )}+b^{3} {\mathrm e}^{6 i \left (f x +e \right )}-27 a^{3} {\mathrm e}^{4 i \left (f x +e \right )}-21 a^{2} b \,{\mathrm e}^{4 i \left (f x +e \right )}-29 a \,b^{2} {\mathrm e}^{4 i \left (f x +e \right )}-3 b^{3} {\mathrm e}^{4 i \left (f x +e \right )}-27 a^{3} {\mathrm e}^{2 i \left (f x +e \right )}+a^{2} b \,{\mathrm e}^{2 i \left (f x +e \right )}+23 a \,b^{2} {\mathrm e}^{2 i \left (f x +e \right )}+3 b^{3} {\mathrm e}^{2 i \left (f x +e \right )}-9 a^{3}+17 a^{2} b -7 a \,b^{2}-b^{3}\right )}{4 \left (-a \,{\mathrm e}^{4 i \left (f x +e \right )}+b \,{\mathrm e}^{4 i \left (f x +e \right )}-2 a \,{\mathrm e}^{2 i \left (f x +e \right )}-2 b \,{\mathrm e}^{2 i \left (f x +e \right )}-a +b \right )^{2} \left (-a^{3}+3 a^{2} b -3 a \,b^{2}+b^{3}\right ) \left (-a +b \right ) a f}-\frac {15 \sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-a b}-a -b}{a -b}\right )}{16 \left (a -b \right )^{4} f}-\frac {5 \sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-a b}-a -b}{a -b}\right ) b}{8 a \left (a -b \right )^{4} f}+\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-a b}-a -b}{a -b}\right ) b^{2}}{16 a^{2} \left (a -b \right )^{4} f}+\frac {15 \sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-a b}+a +b}{a -b}\right )}{16 \left (a -b \right )^{4} f}+\frac {5 \sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-a b}+a +b}{a -b}\right ) b}{8 a \left (a -b \right )^{4} f}-\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-a b}+a +b}{a -b}\right ) b^{2}}{16 a^{2} \left (a -b \right )^{4} f}\) \(764\)

input
int(sin(f*x+e)^2/(a+b*tan(f*x+e)^2)^3,x,method=_RETURNVERBOSE)
 
output
1/f*(-1/(a-b)^4*b*((1/8*b*(7*a^2-6*a*b-b^2)/a*tan(f*x+e)^3+(9/8*a^2-5/4*a* 
b+1/8*b^2)*tan(f*x+e))/(a+b*tan(f*x+e)^2)^2+1/8*(15*a^2+10*a*b-b^2)/a/(a*b 
)^(1/2)*arctan(b*tan(f*x+e)/(a*b)^(1/2)))+1/(a-b)^4*((-1/2*a+1/2*b)*tan(f* 
x+e)/(1+tan(f*x+e)^2)+1/2*(a+5*b)*arctan(tan(f*x+e))))
 
3.1.87.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 493 vs. \(2 (175) = 350\).

Time = 0.39 (sec) , antiderivative size = 1076, normalized size of antiderivative = 5.58 \[ \int \frac {\sin ^2(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^3} \, dx=\text {Too large to display} \]

input
integrate(sin(f*x+e)^2/(a+b*tan(f*x+e)^2)^3,x, algorithm="fricas")
 
output
[1/32*(16*(a^4 + 3*a^3*b - 9*a^2*b^2 + 5*a*b^3)*f*x*cos(f*x + e)^4 + 32*(a 
^3*b + 4*a^2*b^2 - 5*a*b^3)*f*x*cos(f*x + e)^2 + 16*(a^2*b^2 + 5*a*b^3)*f* 
x - ((15*a^4 - 20*a^3*b - 6*a^2*b^2 + 12*a*b^3 - b^4)*cos(f*x + e)^4 + 15* 
a^2*b^2 + 10*a*b^3 - b^4 + 2*(15*a^3*b - 5*a^2*b^2 - 11*a*b^3 + b^4)*cos(f 
*x + e)^2)*sqrt(-b/a)*log(((a^2 + 6*a*b + b^2)*cos(f*x + e)^4 - 2*(3*a*b + 
 b^2)*cos(f*x + e)^2 - 4*((a^2 + a*b)*cos(f*x + e)^3 - a*b*cos(f*x + e))*s 
qrt(-b/a)*sin(f*x + e) + b^2)/((a^2 - 2*a*b + b^2)*cos(f*x + e)^4 + 2*(a*b 
 - b^2)*cos(f*x + e)^2 + b^2)) - 4*(4*(a^4 - 3*a^3*b + 3*a^2*b^2 - a*b^3)* 
cos(f*x + e)^5 + (17*a^3*b - 33*a^2*b^2 + 15*a*b^3 + b^4)*cos(f*x + e)^3 + 
 (11*a^2*b^2 - 10*a*b^3 - b^4)*cos(f*x + e))*sin(f*x + e))/((a^7 - 6*a^6*b 
 + 15*a^5*b^2 - 20*a^4*b^3 + 15*a^3*b^4 - 6*a^2*b^5 + a*b^6)*f*cos(f*x + e 
)^4 + 2*(a^6*b - 5*a^5*b^2 + 10*a^4*b^3 - 10*a^3*b^4 + 5*a^2*b^5 - a*b^6)* 
f*cos(f*x + e)^2 + (a^5*b^2 - 4*a^4*b^3 + 6*a^3*b^4 - 4*a^2*b^5 + a*b^6)*f 
), 1/16*(8*(a^4 + 3*a^3*b - 9*a^2*b^2 + 5*a*b^3)*f*x*cos(f*x + e)^4 + 16*( 
a^3*b + 4*a^2*b^2 - 5*a*b^3)*f*x*cos(f*x + e)^2 + 8*(a^2*b^2 + 5*a*b^3)*f* 
x + ((15*a^4 - 20*a^3*b - 6*a^2*b^2 + 12*a*b^3 - b^4)*cos(f*x + e)^4 + 15* 
a^2*b^2 + 10*a*b^3 - b^4 + 2*(15*a^3*b - 5*a^2*b^2 - 11*a*b^3 + b^4)*cos(f 
*x + e)^2)*sqrt(b/a)*arctan(1/2*((a + b)*cos(f*x + e)^2 - b)*sqrt(b/a)/(b* 
cos(f*x + e)*sin(f*x + e))) - 2*(4*(a^4 - 3*a^3*b + 3*a^2*b^2 - a*b^3)*cos 
(f*x + e)^5 + (17*a^3*b - 33*a^2*b^2 + 15*a*b^3 + b^4)*cos(f*x + e)^3 +...
 
3.1.87.6 Sympy [F(-1)]

Timed out. \[ \int \frac {\sin ^2(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^3} \, dx=\text {Timed out} \]

input
integrate(sin(f*x+e)**2/(a+b*tan(f*x+e)**2)**3,x)
 
output
Timed out
 
3.1.87.7 Maxima [A] (verification not implemented)

Time = 0.30 (sec) , antiderivative size = 346, normalized size of antiderivative = 1.79 \[ \int \frac {\sin ^2(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^3} \, dx=\frac {\frac {4 \, {\left (f x + e\right )} {\left (a + 5 \, b\right )}}{a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}} - \frac {{\left (15 \, a^{2} b + 10 \, a b^{2} - b^{3}\right )} \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )}{{\left (a^{5} - 4 \, a^{4} b + 6 \, a^{3} b^{2} - 4 \, a^{2} b^{3} + a b^{4}\right )} \sqrt {a b}} - \frac {{\left (11 \, a b^{2} + b^{3}\right )} \tan \left (f x + e\right )^{5} + {\left (17 \, a^{2} b + 6 \, a b^{2} + b^{3}\right )} \tan \left (f x + e\right )^{3} + {\left (4 \, a^{3} + 9 \, a^{2} b - a b^{2}\right )} \tan \left (f x + e\right )}{{\left (a^{4} b^{2} - 3 \, a^{3} b^{3} + 3 \, a^{2} b^{4} - a b^{5}\right )} \tan \left (f x + e\right )^{6} + a^{6} - 3 \, a^{5} b + 3 \, a^{4} b^{2} - a^{3} b^{3} + {\left (2 \, a^{5} b - 5 \, a^{4} b^{2} + 3 \, a^{3} b^{3} + a^{2} b^{4} - a b^{5}\right )} \tan \left (f x + e\right )^{4} + {\left (a^{6} - a^{5} b - 3 \, a^{4} b^{2} + 5 \, a^{3} b^{3} - 2 \, a^{2} b^{4}\right )} \tan \left (f x + e\right )^{2}}}{8 \, f} \]

input
integrate(sin(f*x+e)^2/(a+b*tan(f*x+e)^2)^3,x, algorithm="maxima")
 
output
1/8*(4*(f*x + e)*(a + 5*b)/(a^4 - 4*a^3*b + 6*a^2*b^2 - 4*a*b^3 + b^4) - ( 
15*a^2*b + 10*a*b^2 - b^3)*arctan(b*tan(f*x + e)/sqrt(a*b))/((a^5 - 4*a^4* 
b + 6*a^3*b^2 - 4*a^2*b^3 + a*b^4)*sqrt(a*b)) - ((11*a*b^2 + b^3)*tan(f*x 
+ e)^5 + (17*a^2*b + 6*a*b^2 + b^3)*tan(f*x + e)^3 + (4*a^3 + 9*a^2*b - a* 
b^2)*tan(f*x + e))/((a^4*b^2 - 3*a^3*b^3 + 3*a^2*b^4 - a*b^5)*tan(f*x + e) 
^6 + a^6 - 3*a^5*b + 3*a^4*b^2 - a^3*b^3 + (2*a^5*b - 5*a^4*b^2 + 3*a^3*b^ 
3 + a^2*b^4 - a*b^5)*tan(f*x + e)^4 + (a^6 - a^5*b - 3*a^4*b^2 + 5*a^3*b^3 
 - 2*a^2*b^4)*tan(f*x + e)^2))/f
 
3.1.87.8 Giac [A] (verification not implemented)

Time = 0.98 (sec) , antiderivative size = 272, normalized size of antiderivative = 1.41 \[ \int \frac {\sin ^2(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^3} \, dx=\frac {\frac {4 \, {\left (f x + e\right )} {\left (a + 5 \, b\right )}}{a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}} - \frac {{\left (15 \, a^{2} b + 10 \, a b^{2} - b^{3}\right )} {\left (\pi \left \lfloor \frac {f x + e}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )\right )}}{{\left (a^{5} - 4 \, a^{4} b + 6 \, a^{3} b^{2} - 4 \, a^{2} b^{3} + a b^{4}\right )} \sqrt {a b}} - \frac {4 \, \tan \left (f x + e\right )}{{\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} {\left (\tan \left (f x + e\right )^{2} + 1\right )}} - \frac {7 \, a b^{2} \tan \left (f x + e\right )^{3} + b^{3} \tan \left (f x + e\right )^{3} + 9 \, a^{2} b \tan \left (f x + e\right ) - a b^{2} \tan \left (f x + e\right )}{{\left (a^{4} - 3 \, a^{3} b + 3 \, a^{2} b^{2} - a b^{3}\right )} {\left (b \tan \left (f x + e\right )^{2} + a\right )}^{2}}}{8 \, f} \]

input
integrate(sin(f*x+e)^2/(a+b*tan(f*x+e)^2)^3,x, algorithm="giac")
 
output
1/8*(4*(f*x + e)*(a + 5*b)/(a^4 - 4*a^3*b + 6*a^2*b^2 - 4*a*b^3 + b^4) - ( 
15*a^2*b + 10*a*b^2 - b^3)*(pi*floor((f*x + e)/pi + 1/2)*sgn(b) + arctan(b 
*tan(f*x + e)/sqrt(a*b)))/((a^5 - 4*a^4*b + 6*a^3*b^2 - 4*a^2*b^3 + a*b^4) 
*sqrt(a*b)) - 4*tan(f*x + e)/((a^3 - 3*a^2*b + 3*a*b^2 - b^3)*(tan(f*x + e 
)^2 + 1)) - (7*a*b^2*tan(f*x + e)^3 + b^3*tan(f*x + e)^3 + 9*a^2*b*tan(f*x 
 + e) - a*b^2*tan(f*x + e))/((a^4 - 3*a^3*b + 3*a^2*b^2 - a*b^3)*(b*tan(f* 
x + e)^2 + a)^2))/f
 
3.1.87.9 Mupad [B] (verification not implemented)

Time = 15.11 (sec) , antiderivative size = 4997, normalized size of antiderivative = 25.89 \[ \int \frac {\sin ^2(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^3} \, dx=\text {Too large to display} \]

input
int(sin(e + f*x)^2/(a + b*tan(e + f*x)^2)^3,x)
 
output
- ((tan(e + f*x)^5*(11*a*b^2 + b^3))/(8*a*(3*a*b^2 - 3*a^2*b + a^3 - b^3)) 
 + (tan(e + f*x)*(9*a*b + 4*a^2 - b^2))/(8*(a - b)*(a^2 - 2*a*b + b^2)) + 
(b*tan(e + f*x)^3*(6*a*b + 17*a^2 + b^2))/(8*a*(a - b)*(a^2 - 2*a*b + b^2) 
))/(f*(tan(e + f*x)^2*(2*a*b + a^2) + tan(e + f*x)^4*(2*a*b + b^2) + a^2 + 
 b^2*tan(e + f*x)^6)) - (atan(((((tan(e + f*x)*(b^7 - 20*a*b^6 + 470*a^2*b 
^5 + 460*a^3*b^4 + 241*a^4*b^3))/(32*(a^8 - 6*a^7*b + a^2*b^6 - 6*a^3*b^5 
+ 15*a^4*b^4 - 20*a^5*b^3 + 15*a^6*b^2)) - ((((17*a^2*b^11)/2 - (a*b^12)/2 
 - 48*a^3*b^10 + 138*a^4*b^9 - 231*a^5*b^8 + 231*a^6*b^7 - 126*a^7*b^6 + 1 
8*a^8*b^5 + (39*a^9*b^4)/2 - (23*a^10*b^3)/2 + 2*a^11*b^2)/(9*a^10*b - a^1 
1 + a^2*b^9 - 9*a^3*b^8 + 36*a^4*b^7 - 84*a^5*b^6 + 126*a^6*b^5 - 126*a^7* 
b^4 + 84*a^8*b^3 - 36*a^9*b^2) - (tan(e + f*x)*(a*1i + b*5i)*(256*a^2*b^11 
 - 1792*a^3*b^10 + 5120*a^4*b^9 - 7168*a^5*b^8 + 3584*a^6*b^7 + 3584*a^7*b 
^6 - 7168*a^8*b^5 + 5120*a^9*b^4 - 1792*a^10*b^3 + 256*a^11*b^2))/(128*(a^ 
4 - 4*a^3*b - 4*a*b^3 + b^4 + 6*a^2*b^2)*(a^8 - 6*a^7*b + a^2*b^6 - 6*a^3* 
b^5 + 15*a^4*b^4 - 20*a^5*b^3 + 15*a^6*b^2)))*(a*1i + b*5i))/(4*(a^4 - 4*a 
^3*b - 4*a*b^3 + b^4 + 6*a^2*b^2)))*(a*1i + b*5i)*1i)/(4*(a^4 - 4*a^3*b - 
4*a*b^3 + b^4 + 6*a^2*b^2)) + (((tan(e + f*x)*(b^7 - 20*a*b^6 + 470*a^2*b^ 
5 + 460*a^3*b^4 + 241*a^4*b^3))/(32*(a^8 - 6*a^7*b + a^2*b^6 - 6*a^3*b^5 + 
 15*a^4*b^4 - 20*a^5*b^3 + 15*a^6*b^2)) + ((((17*a^2*b^11)/2 - (a*b^12)/2 
- 48*a^3*b^10 + 138*a^4*b^9 - 231*a^5*b^8 + 231*a^6*b^7 - 126*a^7*b^6 +...